<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: CheckoutResource</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: CheckoutResource</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>CheckoutResource<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>The JS Buy SDK cart resource</p></div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="CheckoutResource"><span class="type-signature"></span>new CheckoutResource<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line21">line 21</a>
    </li></ul></dd>
    

    

    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="addDiscount"><span class="type-signature"></span>addDiscount<span class="signature">(checkoutId, discountCode)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Applies a discount to an existing checkout using a discount code.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to add discount to.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>discountCode</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The discount code to apply to the checkout.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line200">line 200</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const discountCode = 'best-discount-ever';

client.checkout.addDiscount(checkoutId, discountCode).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="addGiftCards"><span class="type-signature"></span>addGiftCards<span class="signature">(checkoutId, giftCardCodes)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Applies gift cards to an existing checkout using a list of gift card codes</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to add gift cards to.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>giftCardCodes</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;String></span>


            
            </td>

            

            

            <td class="description last"><p>The gift card codes to apply to the checkout.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line244">line 244</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const giftCardCodes = ['6FD8853DAGAA949F'];

client.checkout.addGiftCards(checkoutId, giftCardCodes).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="addLineItems"><span class="type-signature"></span>addLineItems<span class="signature">(checkoutId, lineItems)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Adds line items to an existing checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to add line items to.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lineItems</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            

            

            <td class="description last"><p>A list of line items to add to the checkout. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/checkoutlineiteminput">Storefront API reference</a> for valid input fields for each line item.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line177">line 177</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const lineItems = [{variantId: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMjc5Mg==', quantity: 5}];

client.checkout.addLineItems(checkoutId, lineItems).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">(input<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Creates a checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>input</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>An input object containing zero or more of:</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>email</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>An email connected to the checkout.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lineItems</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A list of line items in the checkout. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/checkoutlineiteminput">Storefront API reference</a> for valid input fields for each line item.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>shippingAddress</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A shipping address. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/mailingaddressinput">Storefront API reference</a> for valid input fields.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>note</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A note for the checkout.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>customAttributes</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A list of custom attributes for the checkout. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/attributeinput">Storefront API reference</a> for valid input fields.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    
        <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>{String} [input.presentmentCurrencyCode ] A presentment currency code. See the <a href="https://help.shopify.com/en/api/storefront-api/reference/enum/currencycode">Storefront API reference</a> for valid currency code values.</li></ul></dd>
    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line87">line 87</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the created checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const input = {
  lineItems: [
    {variantId: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMjc5Mg==', quantity: 5}
  ]
};

client.checkout.create(input).then((checkout) => {
  // Do something with the newly created checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="fetch"><span class="type-signature"></span>fetch<span class="signature">(id)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Fetches a card by ID.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>id</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The id of the card to fetch.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line34">line 34</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with a <code>GraphModel</code> of the cart.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>client.cart.fetch('FlZj9rZXlN5MDY4ZDFiZTUyZTUwNTE2MDNhZjg=').then((cart) => {
  // Do something with the cart
});</code></pre>



        
            

    

    
    <h4 class="name" id="removeDiscount"><span class="type-signature"></span>removeDiscount<span class="signature">(checkoutId)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Removes the applied discount from an existing checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to remove the discount from.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line221">line 221</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';

client.checkout.removeDiscount(checkoutId).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="removeGiftCard"><span class="type-signature"></span>removeGiftCard<span class="signature">(checkoutId, appliedGiftCardId)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Remove a gift card from an existing checkout</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to add gift cards to.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>appliedGiftCardId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The gift card id to remove from the checkout.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line267">line 267</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const appliedGiftCardId = 'Z2lkOi8vc2hvcGlmeS9BcHBsaWVkR2lmdENhcmQvNDI4NTQ1ODAzMTI=';

client.checkout.removeGiftCard(checkoutId, appliedGiftCardId).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="removeLineItems"><span class="type-signature"></span>removeLineItems<span class="signature">(checkoutId, lineItemIds)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Removes line items from an existing checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to remove line items from.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lineItemIds</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;String></span>


            
            </td>

            

            

            <td class="description last"><p>A list of the ids of line items to remove from the checkout.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line290">line 290</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const lineItemIds = ['TViZGE5Y2U1ZDFhY2FiMmM2YT9rZXk9NTc2YjBhODcwNWIxYzg0YjE5ZjRmZGQ5NjczNGVkZGU='];

client.checkout.removeLineItems(checkoutId, lineItemIds).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="replaceLineItems"><span class="type-signature"></span>replaceLineItems<span class="signature">(checkoutId, lineItems)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Replace line items on an existing checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to add line items to.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lineItems</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            

            

            <td class="description last"><p>A list of line items to set on the checkout. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/checkoutlineiteminput">Storefront API reference</a> for valid input fields for each line item.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line313">line 313</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const lineItems = [{variantId: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMjc5Mg==', quantity: 5}];

client.checkout.replaceLineItems(checkoutId, lineItems).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="updateAttributes"><span class="type-signature"></span>updateAttributes<span class="signature">(checkoutId, input<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Replaces the value of checkout's custom attributes and/or note with values defined in the input</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The ID of the checkout to update.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>input</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>An input object containing zero or more of:</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>customAttributes</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A list of custom attributes for the checkout. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/attributeinput">Storefront API reference</a> for valid input fields.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>note</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A note for the checkout.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line112">line 112</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const input = {customAttributes: [{key: "MyKey", value: "MyValue"}]};

client.checkout.updateAttributes(checkoutId, input).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="updateEmail"><span class="type-signature"></span>updateEmail<span class="signature">(checkoutId, email)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Replaces the value of checkout's email address</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to update.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>email</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The email address to apply to the checkout.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line154">line 154</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const email = 'user@example.com';

client.checkout.updateEmail(checkoutId, email).then((checkout) => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="updateLineItems"><span class="type-signature"></span>updateLineItems<span class="signature">(checkoutId, lineItems)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Updates line items on an existing checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to update a line item on.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lineItems</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;Object></span>


            
            </td>

            

            

            <td class="description last"><p>A list of line item information to update. See the <a href="https://help.shopify.com/api/storefront-api/reference/input-object/checkoutlineitemupdateinput">Storefront API reference</a> for valid input fields for each line item.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line346">line 346</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const lineItems = [
  {
    id: 'TViZGE5Y2U1ZDFhY2FiMmM2YT9rZXk9NTc2YjBhODcwNWIxYzg0YjE5ZjRmZGQ5NjczNGVkZGU=',
    quantity: 5,
    variantId: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMjc5Mg=='
  }
];

client.checkout.updateLineItems(checkoutId, lineItems).then(checkout => {
  // Do something with the updated checkout
});</code></pre>



        
            

    

    
    <h4 class="name" id="updateShippingAddress"><span class="type-signature"></span>updateShippingAddress<span class="signature">(checkoutId, shippingAddress)</span><span class="type-signature"> &rarr; {Promise|GraphModel}</span></h4>
    

    



<div class="description">
    <p>Updates shipping address on an existing checkout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>checkoutId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>The ID of the checkout to update shipping address.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>shippingAddress</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last"><p>A shipping address.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="checkout-resource.js.html">checkout-resource.js</a>, <a href="checkout-resource.js.html#line380">line 380</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A promise resolving with the updated checkout.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>
|

<span class="param-type">GraphModel</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>const checkoutId = `'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
const shippingAddress = {
   address1: 'Chestnut Street 92',
   address2: 'Apartment 2',
   city: 'Louisville',
   company: null,
   country: 'United States',
   firstName: 'Bob',
   lastName: 'Norman',
   phone: '555-625-1199',
   province: 'Kentucky',
   zip: '40202'
 };

client.checkout.updateShippingAddress(checkoutId, shippingAddress).then(checkout => {
  // Do something with the updated checkout
});</code></pre>



        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageHelpers.html">ImageHelpers</a></li><li><a href="ProductHelpers.html">ProductHelpers</a></li></ul><h3>Classes</h3><ul><li><a href="CheckoutResource.html">CheckoutResource</a></li><li><a href="Client.html">Client</a></li><li><a href="CollectionResource.html">CollectionResource</a></li><li><a href="Config.html">Config</a></li><li><a href="ImageResource.html">ImageResource</a></li><li><a href="ProductResource.html">ProductResource</a></li><li><a href="ShopResource.html">ShopResource</a></li></ul><h3>Global</h3><ul><li><a href="global.html#normalizeCartMoneyFieldDecimalPlaces">normalizeCartMoneyFieldDecimalPlaces</a></li><li><a href="global.html#shouldReturnWithOneDecimalPlace">shouldReturnWithOneDecimalPlace</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Mar 12 2025 16:11:31 GMT-0400 (Eastern Daylight Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>